package flexlingo
{
	import flexlingo.vo.LangPairVO;
	import flexlingo.vo.LanguageVO;
	
	public class Language
	{	
		
		
		
		public static var ARABIC : LanguageVO = new LanguageVO("ar","Arabic");
		public static var CHINESE : LanguageVO = new LanguageVO("zh","Chinese");
		public static var CHINESE_SIMPLIFIED : LanguageVO = new LanguageVO("zh-CN","Chinese Simplified");
		public static var CHINESE_TRADITIONAL : LanguageVO = new LanguageVO("zh-TW","Chinese Traditional");
		public static var DUTCH : LanguageVO = new LanguageVO("nl","Dutch");	
		public static var ENGLISH : LanguageVO = new LanguageVO("en","English");
		public static var FRENCH : LanguageVO = new LanguageVO("fr","French");	
		public static var GERMAN : LanguageVO = new LanguageVO("de","German");
		public static var GREEK : LanguageVO = new LanguageVO("el","Greek");
		public static var ITALIAN : LanguageVO = new LanguageVO("it","Italian");
		public static var JAPANESE : LanguageVO = new LanguageVO("ja","Japanese");
		public static var KOREAN : LanguageVO = new LanguageVO("ko","Korean");
		public static var PORTUGESE : LanguageVO = new LanguageVO("pt","Portugese");
		public static var RUSSIAN : LanguageVO = new LanguageVO("ru","Russian");
		public static var SPANISH : LanguageVO = new LanguageVO("es","Spanish");
		
		
		public static function getLangByCode(langCode:String):LanguageVO
		{
			
			for each( var language : LanguageVO in Language.languages )
			{
				if( language.langCode == langCode )
					return language;
			}
		
			return ENGLISH;
		}
		
		
        private static var _languages : Array;

        public static function get languages() : Array
        {
        	
        	if(_languages == null)
        	{
        		_languages = [];
        		
        		_languages.push( ARABIC );
        		_languages.push( CHINESE );
        		_languages.push( CHINESE_SIMPLIFIED );
        		_languages.push( CHINESE_TRADITIONAL );
        		_languages.push( DUTCH );
        		_languages.push( ENGLISH );
        		_languages.push( FRENCH );
        		_languages.push( GERMAN );
        		_languages.push( GREEK );
        		_languages.push( ITALIAN );
        		_languages.push( JAPANESE );
        		_languages.push( KOREAN );
        		_languages.push( PORTUGESE );
        		_languages.push( RUSSIAN );
        		_languages.push( SPANISH );
        	}
        	 
        	return _languages;
        }
       
    	
        private static var _languagePairs : Array;           
        
        public static function get languagePairs() : Array
        {
        	if(_languagePairs == null)
        	{
        		_languagePairs = [];
        		//_languagePairs.push( new LangPairVO(ARABIC,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(CHINESE,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(CHINESE_SIMPLIFIED,CHINESE_TRADITIONAL) );
        		//_languagePairs.push( new LangPairVO(CHINESE_TRADITIONAL,CHINESE_SIMPLIFIED) );
        		//_languagePairs.push( new LangPairVO(DUTCH,ENGLISH) );
        		_languagePairs.push( new LangPairVO(ENGLISH,ARABIC) );
        		_languagePairs.push( new LangPairVO(ENGLISH,CHINESE) );
        		_languagePairs.push( new LangPairVO(ENGLISH,CHINESE_SIMPLIFIED) );
        		_languagePairs.push( new LangPairVO(ENGLISH,CHINESE_TRADITIONAL) );
        		_languagePairs.push( new LangPairVO(ENGLISH,DUTCH) );
        		_languagePairs.push( new LangPairVO(ENGLISH,FRENCH) );
        		_languagePairs.push( new LangPairVO(ENGLISH,GERMAN) );
        		_languagePairs.push( new LangPairVO(ENGLISH,GREEK) );
        		_languagePairs.push( new LangPairVO(ENGLISH,ITALIAN) );
        		_languagePairs.push( new LangPairVO(ENGLISH,JAPANESE) );
        		_languagePairs.push( new LangPairVO(ENGLISH,KOREAN) );
        		_languagePairs.push( new LangPairVO(ENGLISH,PORTUGESE) );
        		_languagePairs.push( new LangPairVO(ENGLISH,RUSSIAN) );
        		_languagePairs.push( new LangPairVO(ENGLISH,SPANISH) );
        		//_languagePairs.push( new LangPairVO(FRENCH,GERMAN) );
        		//_languagePairs.push( new LangPairVO(FRENCH,KOREAN) );
        		//_languagePairs.push( new LangPairVO(GERMAN,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(GERMAN,FRENCH) );
        		//
        		//_languagePairs.push( new LangPairVO(GREEK,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(ITALIAN,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(JAPANESE,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(KOREAN,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(PORTUGESE,ENGLISH) );
        		
        		//_languagePairs.push( new LangPairVO(RUSSIAN,ENGLISH) );
        		//_languagePairs.push( new LangPairVO(SPANISH,ENGLISH) );
        	
        	}
        	
        	return _languagePairs;
        } 
    
	}
	
	
}